package com.share.iostream;

import java.io.*;

public class TestFileReader {
	public static void main(String[] args) {
		FileReader fr = null;
		int c = 0;
		int ln = 0;
		try {
			fr = new FileReader(
					"E:\\Coursera-Java\\Eclipse\\workspace\\chapter18-IO\\src\\com\\share\\iostream\\TestFileReader.java");		

			while ((c = fr.read()) != -1) {
				System.out.print((char) c);
				ln++;
			}
			fr.close();
		} catch (FileNotFoundException e) {
			System.out.println("找不到指定文件");
		} catch (IOException e) {
			System.out.println("文件读取错误");
		}

		System.out.println("\n统计字符数:" + ln);
	}
}